<template>
  <div>
    <p>count: {{count}}</p>
    <p>age: {{age}}</p>
    <button @click="age++">+1</button>
  </div>
</template>

<script>
import { ref, watch, isRef, isReactive } from 'vue';

export default {
  setup () {
    const count = ref(1)
    const age = ref(18)


    // !可以监听多个 ref 数据
    watch([count, age], (newValue, oldValue) => {
      console.log(newValue, oldValue);
    }, {
      immediate: true
    })

    return {count, age}
  }
}
</script>

<style lang="scss" scoped>

</style>